package org.example;

import org.example.dao.UserDao;
import org.example.pojo.Hellowold;
import org.example.pojo.User;
import org.example.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * //代表加载application.xml
 */
public class Main {
    public static void main(String[] args) throws SQLException {
//        ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");//代表加载application.xml
//        //引入依赖
////        Hellowold hellowold = (Hellowold) context.getBean("hellowold");
////        System.out.println(hellowold.getName());
////        System.out.println(hellowold.getAge());
//        User user = (User) context.getBean("user");
//        Hellowold hellowold1 = user.getHellowold();
//        System.out.println(hellowold1.getName());
////        UserDao userdao = (UserDao) context.getBean("userDao");
////        userdao.Save();
////        System.out.println(userdao+"123121");
////        UserService userService = (UserService) context.getBean("userService");
////        userService.Save();
////        System.out.println(userService);
//////        JDBC连接数据库
////        String driver = "com.mysql.cj.jdbc.Driver";
////        String url = "jdbc:mysql://localhost:3306/cloud_user?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&useSSL=false&serverTimezone=GMT%2b8&allowPublicKeyRetrieval=true";
////        String username="root";
////        String password="123456";
////        Connection connection = DriverManager.getConnection(url,username,password);
////        System.out.println(connection);
    }
}